package com.ruoyi.clothing.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.clothing.mapper.SysFabricMapper;
import com.ruoyi.clothing.domain.SysFabric;
import com.ruoyi.clothing.service.ISysFabricService;

/**
 * fabricService业务层处理
 * 
 * @author weh
 * @date 2024-01-04
 */
@Service
public class SysFabricServiceImpl implements ISysFabricService 
{
    @Autowired
    private SysFabricMapper sysFabricMapper;

    /**
     * 查询fabric
     * 
     * @param id fabric主键
     * @return fabric
     */
    @Override
    public SysFabric selectSysFabricById(Long id)
    {
        return sysFabricMapper.selectSysFabricById(id);
    }

    /**
     * 查询fabric列表
     * 
     * @param sysFabric fabric
     * @return fabric
     */
    @Override
    public List<SysFabric> selectSysFabricList(SysFabric sysFabric)
    {
        return sysFabricMapper.selectSysFabricList(sysFabric);
    }

    /**
     * 新增fabric
     * 
     * @param sysFabric fabric
     * @return 结果
     */
    @Override
    public int insertSysFabric(SysFabric sysFabric)
    {
        sysFabric.setCreateTime(DateUtils.getNowDate());
        return sysFabricMapper.insertSysFabric(sysFabric);
    }

    /**
     * 修改fabric
     * 
     * @param sysFabric fabric
     * @return 结果
     */
    @Override
    public int updateSysFabric(SysFabric sysFabric)
    {
        sysFabric.setUpdateTime(DateUtils.getNowDate());
        return sysFabricMapper.updateSysFabric(sysFabric);
    }

    /**
     * 批量删除fabric
     * 
     * @param ids 需要删除的fabric主键
     * @return 结果
     */
    @Override
    public int deleteSysFabricByIds(Long[] ids)
    {
        return sysFabricMapper.deleteSysFabricByIds(ids);
    }

    /**
     * 删除fabric信息
     * 
     * @param id fabric主键
     * @return 结果
     */
    @Override
    public int deleteSysFabricById(Long id)
    {
        return sysFabricMapper.deleteSysFabricById(id);
    }
}
